// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import '@/assets/css/global.css'
import request from '@/utils/request.js'

Vue.prototype.$request = request;

Vue.use(ElementUI);

Vue.config.productionTip = false

// 从 localStorage 中获取 userid 的值，如果不存在则设置为 null
const userid = localStorage.getItem('userid') || null;

// 声明一个全局变量，使其在所有组件中可访问
Vue.prototype.$globalVariable = {
  // 设置 userid 为 localStorage 中的值
  userid: userid,
  // 其他全局变量...
};

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  components: { App },
  template: '<App/>'
})
